<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/18
 * Time: 16:24
 */

namespace core_class;


class Cache
{
    public static function cache_file_get_contents($url){
        $filename = md5($url).".html";
        $dir = "cache/";
        if(file_exists($dir.$filename)){
            return file_get_contents($dir.$filename);
        }else{
            $html = file_get_contents($url);
            file_put_contents($dir.$filename, $html);
            return $html;
        }
    }
}